package NGUYENVANDOAN.OOP.EXCERCISES.LEVEL02.EX01_OPTIONAL;

public class RectangleEntity {
	private double width;
	private  double height;
	private  String color;
    
    public RectangleEntity(){
        //default rectangle
        width = 1.0;
        height = 1.0;
        color = "White";
    }
    
    public RectangleEntity(double width, double height){
        this.width = width;
        this.height = height;
    }

    //Generate properties
    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
    
    public double Area(RectangleEntity objRectangle){
        return objRectangle.getWidth() * 
                                    objRectangle.getHeight();
    }
    
    public double Perimeter(RectangleEntity objRectangle){
        return (objRectangle.getWidth() + 
                                objRectangle.getHeight())*2;
    }
}
